package com.sunday.common.http.apache.sentinel.config;

import com.sunday.common.http.apache.sentinel.extractor.ApacheHttpClientResourceExtractor;
import com.sunday.common.http.apache.sentinel.extractor.DefaultApacheHttpClientResourceExtractor;

/**
 * 用于配置结合使用阿里巴巴的Sentinel库与Apache HttpClient的相关设置
 *
 * @author zsy
 * @since 2024/1/18
 */
public class SentinelApacheHttpClientConfig {

    private String prefix = "httpclient:";
    private ApacheHttpClientResourceExtractor extractor = new DefaultApacheHttpClientResourceExtractor();

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        assert prefix != null : "prefix cannot be null";
        this.prefix = prefix;
    }

    public ApacheHttpClientResourceExtractor getExtractor() {
        return extractor;
    }

    public void setExtractor(ApacheHttpClientResourceExtractor extractor) {
        assert extractor != null : "extractor cannot be null";
        this.extractor = extractor;
    }

    public static SentinelApacheHttpClientConfig create() {
        return new SentinelApacheHttpClientConfig();
    }

}
